<!DOCTYPE html>
<html lang="en" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
      xmlns:th="http://www.thymeleaf.org"
>

<head>

    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">

</head>
<style>
    .cx > div {
        margin-bottom: 10px;
    }
</style>
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md4 layui-col-lg2">
            <div class="layui-card">
                <div class="layui-card-body mini-bar" id="leftTree">
                </div>
            </div>
        </div>
        <!--  ------------------------------表格  -->
        <div class="layui-col-sm12 layui-col-md8 layui-col-lg10">
            <!--            工商历史表-->
            <div class="annual_table_div">
                <div id="searchAnnuals">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="a_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_registration_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入注册号">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_registration_authority" class="layui-input" autocomplete="off"
                                   placeholder="请输入登录机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_domination" class="layui-input" autocomplete="off"
                                   placeholder="请输入管辖机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_address" class="layui-input" autocomplete="off"
                                   placeholder="请输入地址">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_contact_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系电话">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_date_of_establishment"
                                   placeholder="请选择成立日期">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_approval_date" placeholder="请选择核准日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <input type="text" class="layui-input" id="a_enterprise_status" placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_liaison_man_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员姓名">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="a_liaison_man_phone" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员手机号码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="a_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_report_status">
                                <option value="0">请选择企业上报状态</option>
                                <option value="1">已上报</option>
                                <option value="2">未上报</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_enterprise_type">
                                <option value="0">请选择企业类型</option>
                                <option value="1">企业</option>
                                <option value="2">农合社</option>
                                <option value="3">个人</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="a_matching">
                                <option value="0">请选择匹配状态</option>
                                <option value="1">已匹配</option>
                                <option value="2">未匹配</option>
                            </select>
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchA()" id="searchAnnual">查询</button>
                        </div>
                    </div>
                </div>
                <table class="layui-table" id="annualsTable" lay-filter="annualsTable"></table>
            </div>
            <!--            核准历史表-->
            <div class="confirm_table_div" hidden>
                <div id="searchConfirm">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="registration_authority" class="layui-input" autocomplete="off"
                                   placeholder="请输入登录机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="domination" class="layui-input" autocomplete="off"
                                   placeholder="请输入管辖机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="address" class="layui-input" autocomplete="off" placeholder="请输入地址">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchC()" id="searchConfirms">查询</button>
                        </div>
                    </div>

                </div>
                <table class="layui-table" id="confirmTable" lay-filter="confirmTable"></table>
            </div>
            <!--            税务历史表-->
            <div class="revenue_table_div" hidden>
                <div id="searchParam">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="r_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_legal_representative" class="layui-input" autocomplete="off"
                                   placeholder="请输入法定代表人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_business_place" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营场所">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_business_scope" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营范围">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_contacts" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="r_contact_information" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系方式">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <input type="text" id="r_enterprise_status" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="r_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchR()" id="searchRevenue">查询</button>
                        </div>
                    </div>

                </div>
                <table class="layui-table" id="revenueTable" lay-filter="revenueTable"></table>
            </div>
            <!--            匹配历史表-->
            <div class="matching_table_div" hidden>
                <div id="searchMatchings">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="m_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_registration_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入注册号">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_domination" class="layui-input" autocomplete="off"
                                   placeholder="请输入管辖机关">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_address" class="layui-input" autocomplete="off"
                                   placeholder="请输入地址">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_contact_number" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系电话">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="m_date_of_establishment"
                                   placeholder="请选择成立日期">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="m_approval_date" placeholder="请选择核准日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <input type="text" class="layui-input" id="m_enterprise_status" placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_liaison_man_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员姓名">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="m_liaison_man_phone" class="layui-input" autocomplete="off"
                                   placeholder="请输入联络员手机号码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="m_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="m_report_status">
                                <option value="0">请选择企业上报状态</option>
                                <option value="1">已上报</option>
                                <option value="2">未上报</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="m_enterprise_type">
                                <option value="0">请选择企业类型</option>
                                <option value="1">企业</option>
                                <option value="2">农合社</option>
                                <option value="3">个人</option>
                            </select>
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="m_matching">
                                <option value="0">请选择匹配结果</option>
                                <option value="1">匹配成功</option>
                                <option value="2">匹配失败</option>
                            </select>
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchM()" id="searchMatching">查询</button>
                        </div>
                    </div>
                </div>
                <table class="layui-table" id="matchingTable" lay-filter="annualsTable"></table>
            </div>
            <!--            清吊历史表-->
            <div class="qingdiao_table_div" hidden>
                <div id="searchQingdiaos">
                    <div class="layui-form-item cx">
                        <div class="layui-input-inline">
                            <input type="text" id="q_enterprise_name" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业名称">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_social_credit_code" class="layui-input" autocomplete="off"
                                   placeholder="请输入统一社会信用代码">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_legal_representative" class="layui-input" autocomplete="off"
                                   placeholder="请输入法定代表人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_business_place" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营场所">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_business_scope" class="layui-input" autocomplete="off"
                                   placeholder="请输入经营范围">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_contacts" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系人">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_contact_information" class="layui-input" autocomplete="off"
                                   placeholder="请输入联系方式">
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" id="q_enterprise_status" class="layui-input" autocomplete="off"
                                   placeholder="请输入企业状态">
                        </div>
                        <div class="layui-input-inline layui-form">
                            <select id="r_report_status">
                                <option value="0">请选择税务状态</option>
                                <option value="1">空号</option>
                                <option value="2">税务上报异常</option>
                                <option value="3">黑名单</option>
                            </select>
                        </div>
                        <div class="layui-input-inline">
                            <input type="text" readonly class="layui-input" id="q_create_time" placeholder="请选择创建日期">
                        </div>
                        <div class="layui-input-inline ">
                            <button class="layui-btn" onclick="searchQ()" id="searchQingdiao">查询</button>
                        </div>
                    </div>
                </div>
                <table class="layui-table" id="qingdiaoTable" lay-filter="revenueTable"></table>
            </div>
            <!--            统计历史表-->
            <div class="statistics_table_div" hidden>
                <table class="layui-table" id="statisticsTable" lay-filter="statisticsTable"></table>
            </div>
            <!--            统计历史表(含清吊和空号)-->
            <div class="statistics1_table_div" hidden>
                <table class="layui-table" id="statisticsTable1" lay-filter="statisticsTable1"></table>
            </div>
        </div>
    </div>
</div>
<div id="deptTree" style="display: none"></div>

<script type="text/html" id="toolbar1">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">工商历史报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar2">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">核准历史报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual1" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar3">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">税务历史报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual2" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar4">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">匹配历史报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual3" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar5">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">清吊历史报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual4" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar6">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">统计报表
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual5" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>
<script type="text/html" id="toolbar7">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual1"
                style="background-color: #f2f2f2; color: #666666; font-size: 16px;" disabled="disabled">统计报表(含清吊和空号)
        </button>
        <button class="layui-btn layui-btn-sm" lay-event="downloadAnnual16" style="float: right;margin-right: -118px;">
            下载
        </button>
    </div>
</script>

<script src="/layui/layui.all.js"></script>
<script src="/js/core.util.js"></script>
<script type="text/html" id="xuhao">
    {{d.LAY_TABLE_INDEX+1}}
</script>
<script>
    //获取token
    var token = CoreUtil.getData("access_token");
    //地址栏转义token中的#号
    var tokenQuery = token.replace("#", "%23");
    var tableIns1;
    var tableIns2;
    var tableIns3;
    var tableIns4;
    var tableIns5;
    var tableIns6;
    var tableIns7;
    var table = layui.table;
    var upload = layui.upload;
    var form = layui.form;
    var layer = layui.layer;
    var $ = jQuery = layui.jquery;
    var laydate = layui.laydate;
    var tree = layui.tree;
    var transfer = layui.transfer;
    var type1 = 'type1';
    //工商历史报表
    var establishStartTimeAnnual = null;
    var establishEndTimeAnnual = null;
    var approvalStartTimeAnnual = null;
    var approvalEndTimeAnnual = null;
    var createStartTimeAnnual = null;
    var createEndTimeAnnual = null;
    //核准历史报表
    var createStartTimeApproval = null;
    var createEndTimeApproval = null;
    //税务历史报表
    var createStartTimeTaxation = null;
    var createEndTimeTaxation = null;
    //匹配历史报表
    var establishStartTimeMatching = null;
    var establishEndTimeMatching = null;
    var approvalStartTimeMatching = null;
    var approvalEndTimeMatching = null;
    var createStartTimeMatching = null;
    var createEndTimeMatching = null;
    //清吊历史报表
    var createStartTimeQingdiao = null;
    var createEndTimeQingdiao = null;
    //统计历史报表


    layui.use(['table', 'layer', 'laydate', 'tree', 'transfer', 'upload'], function () {
        initLeftTree();
        //工商历史
        tableIns1 = table.render({
            elem: '#annualsTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/annualHistoryRpt/findAllAnnualHistoryReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar1'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {field: 'enterpriseName', title: '企业名称', width: 200},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 190},
                    {field: 'registrationNumber', title: '注册号', width: 150},
                    {field: 'registrationAuthority', title: '登录机关', width: 200},
                    {field: 'domination', title: '管辖机关', width: 190},
                    {field: 'address', title: '地址', width: 250},
                    {field: 'contactNumber', title: '联系电话', width: 125},
                    {
                        field: 'establishDate', title: '成立日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.establishDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'approvalDate', title: '核准日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.approvalDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {field: 'enterpriseStatus', title: '状态', width: 60},
                    {field: 'liaisonManName', title: '联络员姓名', width: 100},
                    {field: 'liaisonManPhone', title: '联络员电话', width: 125},
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'reportStatus', title: '上报状态', width: 90, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '已上报';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '未上报';
                            }
                        }
                    },
                    {
                        field: 'enterpriseType', title: '企业类型', width: 90, templet: function (item) {
                            if (item.enterpriseType === 1 || item.enterpriseType === "1") {
                                return '企业';
                            }
                            if (item.enterpriseType === 2 || item.enterpriseType === "2") {
                                return '农合社';
                            }
                            if (item.enterpriseType === 3 || item.enterpriseType === "3") {
                                return '个人';
                            }
                        }
                    },
                    {
                        field: 'matching', title: '匹配状态', width: 90, templet: function (item) {
                            if (item.matching === 1 || item.matching === "1") {
                                return '已匹配';
                            }
                            if (item.matching === 2 || item.matching === "2") {
                                return '未匹配';
                            }
                        }
                    }
                ]
            ]
        });
        //核准历史
        tableIns2 = table.render({
            elem: '#confirmTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/approvalHistoryRpt/findAllApprovalHistoryReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar2'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {field: 'registrationAuthority', title: '登录机关', width: 200},
                    {field: 'domination', title: '管辖机关', width: 200},
                    {field: 'address', title: '地址'},
                    {
                        field: 'createTime', title: '创建日期', width: 150, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });
        //税务历史
        tableIns3 = table.render({
            elem: '#revenueTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/taxationHistoryRpt/findAllTaxationHistoryReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar3'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {field: 'enterpriseName', title: '企业名称', width: 250},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 200},
                    {field: 'legalRepresentative', title: '法定代表人', width: 100},
                    {field: 'businessPlace', title: '经营场所', width: 200},
                    {field: 'businessScope', title: '经营范围', width: 200},
                    {field: 'contacts', title: '联系人', width: 80},
                    {field: 'contactInformation', title: '联系方式', width: 125},
                    {field: 'status', title: '状态', width: 60},
                    {
                        field: 'reportStatus', title: '税务状态', width: 90, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '正常';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '税务异常';
                            }
                            if (item.reportStatus === 3 || item.reportStatus === "3") {
                                return '黑名单';
                            }
                        }
                    },
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });
        //匹配历史报表
        tableIns4 = table.render({
            elem: '#matchingTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/matchingRpt/findAllMatchingHistoryReport' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar4'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'enterpriseName', title: '企业名称', width: 250},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 200},
                    {field: 'registrationNumber', title: '注册号', width: 150},
                    {field: 'domination', title: '管辖机关', width: 190},
                    {field: 'address', title: '地址', width: 250},
                    {field: 'contactNumber', title: '联系电话', width: 125},
                    {
                        field: 'establishDate', title: '成立日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.establishDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'approvalDate', title: '核准日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.approvalDate, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {field: 'enterpriseStatus', title: '状态', width: 60},
                    {field: 'liaisonManName', title: '联络员姓名', width: 100},
                    {field: 'liaisonManPhone', title: '联络员电话', width: 125},
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    },
                    {
                        field: 'reportStatus', title: '上报状态', width: 90, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '已上报';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '未上报';
                            }
                        }
                    },
                    {
                        field: 'enterpriseType', title: '企业类型', width: 90, templet: function (item) {
                            if (item.enterpriseType === 1 || item.enterpriseType === "1") {
                                return '企业';
                            }
                            if (item.enterpriseType === 2 || item.enterpriseType === "2") {
                                return '农合社';
                            }
                            if (item.enterpriseType === 3 || item.enterpriseType === "3") {
                                return '个人';
                            }
                        }
                    },
                    {
                        field: 'matchingResult', title: '匹配结果', width: 90, templet: function (item) {
                            if (item.matchingResult === 1 || item.matchingResult === "1") {
                                return '匹配成功';
                            }
                            if (item.matchingResult === 2 || item.matchingResult === "2") {
                                return '匹配失败';
                            }
                        }
                    },
                    {title: '操作', toolbar: '#tool'}
                ]
            ]
        });
        //清吊历史报表
        tableIns5 = table.render({
            elem: '#qingdiaoTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , limits: [10, 100, 1000, 10000]
            , limit: 10 //每页默认显示的数量
            , url: '/qingdiaoHistoryRpt/findAllQingDiaoHistoryReport' //数据接口
            , method: 'POST',
            toolbar: '#toolbar5'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    {type: 'checkbox', fixed: 'left'},
                    {field: 'enterpriseName', title: '企业名称', width: 250},
                    {field: 'socialCreditCode', title: '统一社会信用代码', width: 200},
                    {field: 'legalRepresentative', title: '法定代表人', width: 100},
                    {field: 'businessPlace', title: '经营场所', width: 200},
                    {field: 'businessScope', title: '经营范围', width: 200},
                    {field: 'contacts', title: '联系人', width: 80},
                    {field: 'contactInformation', title: '联系方式', width: 125},
                    {field: 'status', title: '状态', width: 60},
                    {
                        field: 'reportStatus', title: '税务状态', width: 120, templet: function (item) {
                            if (item.reportStatus === 1 || item.reportStatus === "1") {
                                return '空号';
                            }
                            if (item.reportStatus === 2 || item.reportStatus === "2") {
                                return '税务上报异常';
                            }
                            if (item.reportStatus === 3 || item.reportStatus === "3") {
                                return '黑名单';
                            }
                        }
                    },
                    {
                        field: 'createTime', title: '创建日期', width: 140, templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });
        tableIns6 = table.render({
            elem: '#statisticsTable'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , url: '/statisticsRpt/findAllStatisticsHistory' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar6'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    // {title: '编号',templet: '#xuhao'},
                    {
                        field: 'enterpriseType', title: '企业分类', templet: function (item) {
                            if (item.enterpriseType === 1) {
                                return '企业';
                            }
                            if (item.enterpriseType === 2) {
                                return '农合社';
                            }
                            if (item.enterpriseType === 3) {
                                return '个人';
                            }
                        }
                    },
                    {field: 'addressName', title: '街道'},
                    {field: 'annualReport', title: '应上报企业数量'},
                    {field: 'reportedQuantity', title: '已上报企业数量'},
                    {field: 'notReportQuantity', title: '未上报数量'},
                    {
                        field: 'annualReportRate', title: '上报率', templet: function (item) {
                            return item.annualReportRate + '%';
                        }
                    },
                    {field: 'ranking', title: '排名', sort: true},
                    {
                        field: 'createTime', title: '创建日期', templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });
        tableIns7 = table.render({
            elem: '#statisticsTable1'// 表格id
            , contentType: 'application/json'
            , headers: {"authorization": token}
            , page: true //开启分页
            , url: '/statisticsRpt/findAllStatisticsHistory1' //数据接口
            , method: 'POST'
            , toolbar: '#toolbar7'
            , defaultToolbar: []
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                console.log(res);
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": CoreUtil.isEmpty(res.data.list) ? 0 : res.data.total, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data.list) ? null : res.data.list //解析数据列表
                }
            },
            cols: [
                [
                    // {title: '编号',templet: '#xuhao'},
                    {
                        field: 'enterpriseType', title: '企业分类', templet: function (item) {
                            if (item.enterpriseType === 1) {
                                return '企业';
                            }
                            if (item.enterpriseType === 2) {
                                return '农合社';
                            }
                            if (item.enterpriseType === 3) {
                                return '个人';
                            }
                        }
                    },
                    {field: 'addressName', title: '街道'},
                    {field: 'annualReport', title: '应上报企业数量'},
                    {field: 'reportedQuantity', title: '已上报企业数量'},
                    {field: 'notReportQuantity', title: '未上报数量'},
                    {field: 'clearNumber', title: '清吊'},
                    {field: 'emptyNumber', title: '空号'},
                    {
                        field: 'annualReportRate', title: '上报率', templet: function (item) {
                            return item.annualReportRate + '%';
                        }
                    },
                    {field: 'ranking', title: '排名', sort: true},
                    {
                        field: 'createTime', title: '创建日期', templet: function (item) {
                            return "<div>" + layui.util.toDateString(item.createTime, 'yyyy年MM月dd日') + "</div>";
                        }
                    }
                ]
            ]
        });

        /**
         * 工商历史信息下载
         */
        table.on('toolbar', function (obj) {
            switch (obj.event) {
                case 'downloadAnnual':
                    downloadAnnual();
                    break;
                case 'downloadAnnual1':
                    downloadAnnual1();
                    break;
                case 'downloadAnnual2':
                    downloadAnnual2();
                    break;
                case 'downloadAnnual3':
                    downloadAnnual3();
                    break;
                case 'downloadAnnual4':
                    downloadAnnual4();
                    break;
                case 'downloadAnnual5':
                    downloadAnnual5();
                    break;
                case 'downloadAnnual6':
                    downloadAnnual6();
                    break;
            }
        });
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual = function () {
            let data = {
                enterpriseName: $("#a_enterprise_name").val(),
                socialCreditCode: $("#a_social_credit_code").val(),
                registrationNumber: $("#a_registration_number").val(),
                registrationAuthority: $("#a_registration_authority").val(),
                domination: $("#a_domination").val(),
                address: $("#a_address").val(),
                contactNumber: $("#a_contact_number").val(),
                establishStartTime: establishStartTimeAnnual,
                establishEndTime: establishEndTimeAnnual,
                approvalStartTime: approvalStartTimeAnnual,
                approvalEndTime: approvalEndTimeAnnual,
                enterpriseStatus: $("#a_enterprise_status").val(),
                liaisonManName: $("#a_liaison_man_name").val(),
                liaisonManPhone: $("#a_liaison_man_phone").val(),
                createStartTime: createStartTimeAnnual,
                createEndTime: createEndTimeAnnual,
                reportStatus: $("#a_report_status").val(),
                enterpriseType: $("#a_enterprise_type").val(),
                matching: $("#a_matching").val()
            };
            $.ajax({
                type: "post",
                url: "/download/annualHistoryFileName",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {

                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    // a.download = da.data + ".xls";
                    a.href = "/download/annualHistoryDownload?fileName="+da.data;
                    // $("body").append(a); // 修复firefox中无法触发click
                    a.click();
                    $(a).remove();

                    // window.location.href =
                }
            })
        };

        /**
         * 核准历史信息下载
         */
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual1 = function () {
            let data = {
                registrationAuthority: $("#registration_authority").val(),
                domination: $("#domination").val(),
                address: $("#address").val(),
                createStartTime: createStartTimeApproval,
                createEndTime: createEndTimeApproval
            };
            $.ajax({
                type: "post",
                url: "/download/rptApprovalHistoryFileName",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {

                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    // a.download = da.data + ".xls";
                    a.href = "/download/rptApprovalHistoryDownload?fileName="+da.data;
                    // $("body").append(a); // 修复firefox中无法触发click
                    a.click();
                    $(a).remove();

                    // window.location.href =
                }
            })
        };

        /**
         * 税务历史信息下载
         */
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual2 = function () {
            let data = {
                enterpriseName: $("#r_enterprise_name").val(),
                socialCreditCode: $("#r_social_credit_code").val(),
                legalRepresentative: $("#r_legal_representative").val(),
                businessPlace: $("#r_business_place").val(),
                businessScope: $("#r_business_scope").val(),
                contacts: $("#r_contacts").val(),
                contactInformation: $("#r_contact_information").val(),
                status: $("#r_status").val(),
                createStartTime: createStartTimeTaxation,
                createEndTime: createEndTimeTaxation
            }
            $.ajax({
                type: "post",
                url: "/download/taxationHistoryFileName",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {
                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    a.href = "/download/taxationHistoryDownload?fileName="+da.data;
                    a.click();
                    $(a).remove();
                }
            })
        };

        /**
         * 匹配历史信息下载
         */
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual3 = function () {
            let data = {
                enterpriseName: $("#m_enterprise_name").val(),
                socialCreditCode: $("#m_social_credit_code").val(),
                registrationNumber: $("#m_registration_number").val(),
                registrationAuthority: $("#m_registration_authority").val(),
                domination: $("#m_domination").val(),
                address: $("#m_address").val(),
                contactNumber: $("#m_contact_number").val(),
                establishStartTime: establishStartTimeMatching,
                establishEndTime: establishEndTimeMatching,
                approvalStartTime: approvalStartTimeMatching,
                approvalEndTime: approvalEndTimeMatching,
                enterpriseStatus: $("#m_enterprise_status").val(),
                liaisonManName: $("#m_liaison_man_name").val(),
                liaisonManPhone: $("#m_liaison_man_phone").val(),
                createStartTime: createStartTimeMatching,
                createEndTime: createEndTimeMatching,
                reportStatus: $("#m_report_status").val(),
                enterpriseType: $("#m_enterprise_type").val(),
                matchingResult: $("#m_matching").val()
            }
            $.ajax({
                type: "post",
                url: "/download/matchingHistoryReportFileName",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {
                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    a.href = "/download/matchingHistoryDownload?fileName="+da.data;
                    a.click();
                    $(a).remove();
                }
            })
        };

        /**
         * 清吊历史信息下载
         */
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual4 = function () {
            let data = {
                enterpriseName: $("#q_enterprise_name").val(),
                socialCreditCode: $("#q_social_credit_code").val(),
                legalRepresentative: $("#q_legal_representative").val(),
                businessPlace: $("#q_business_place").val(),
                businessScope: $("#q_business_scope").val(),
                contacts: $("#q_contacts").val(),
                contactInformation: $("#q_contact_information").val(),
                status: $("#q_status").val(),
                reportStatus: $("#q_report_status").val(),
                createStartTime: createStartTimeQingdiao,
                createEndTime: createEndTimeQingdiao
            }
            $.ajax({
                type: "post",
                url: "/download/qingDiaoHistoryReportFileName",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {
                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    a.href = "/download/qingDiaoHistoryDownload?fileName="+da.data;
                    a.click();
                    $(a).remove();
                }
            })
        };
        //统计历史报表
        /**
         * 下载按钮调用接口
         *  统计历史报表
         */
        var downloadAnnual5 = function () {
            let data = {
            }
            $.ajax({
                type: "post",
                url: "/download/",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {
                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    a.href = "/download/?fileName="+da.data;
                    a.click();
                    $(a).remove();
                }
            })
        };

        //统计历史报表（含清吊和空号）
        /**
         * 下载按钮调用接口
         */
        var downloadAnnual6 = function () {
            let data = {

            }
            $.ajax({
                type: "post",
                url: "/download/",
                data: JSON.stringify(data),
                contentType: 'application/json; charset=UTF-8',
                dataType: "json",
                success: function (da) {
                    console.log(da.data);
                    let a = document.createElement("a"); // 转换完成，创建一个a标签用于下载
                    a.href = "/download/?fileName="+da.data;
                    a.click();
                    $(a).remove();
                }
            })
        };

        function initLeftTree() {
            var data1 = [{
                title: '默认历史报表',
                id: 1,
                label: '默认历史报表',
                spread: true,
                disabled: true,
                checked: false,
                children: [{
                    title: '工商历史报表',
                    id: 1,
                    label: '工商历史报表',
                    spread: true,
                    enterpriseType: 1,
                    disabled: false,
                    type: 'type1'
                }, {
                    title: '核准历史报表',
                    id: 2,
                    label: '核准历史报表',
                    spread: true,
                    enterpriseType: 2,
                    disabled: false,
                    type: 'type2'
                }, {
                    title: '税务历史报表',
                    id: 3,
                    label: '税务历史报表',
                    spread: true,
                    enterpriseType: 3,
                    disabled: false,
                    type: 'type3'
                }, {
                    title: '匹配历史报表',
                    id: 4,
                    label: '匹配历史报表',
                    spread: true,
                    enterpriseType: 4,
                    disabled: false,
                    type: 'type4'
                }, {
                    title: '清吊历史报表',
                    id: 5,
                    label: '清吊历史报表',
                    spread: true,
                    enterpriseType: 5,
                    disabled: false,
                    type: 'type5'
                }, {
                    title: '统计历史报表',
                    id: 6,
                    label: '统计历史报表',
                    spread: true,
                    enterpriseType: 6,
                    disabled: false,
                    type: 'type6'
                }, {
                    title: '统计历史报表(含清吊和空号)',
                    id: 7,
                    label: '统计历史报表(含清吊和空号)',
                    spread: true,
                    enterpriseType: 7,
                    disabled: false,
                    type: 'type7'
                }]
            }];
            tree.render({
                elem: '#leftTree'
                , data: data1
                , onlyIconControl: true  //是否仅允许节点左侧图标控制展开收缩
                , click: function (obj) {
                    console.log(obj, 456);
                    type1 = obj.data.type;
                    // deptNo = obj.data.deptNo;
                    $("#leftTree span").removeClass('custom-tree-item-clicked');     //清除旧的样式
                    $("#leftTree span:contains(" + obj.data.title + ")").addClass('custom-tree-item-clicked');
                    if (obj.data.id == 1) {
                        $(".annual_table_div").show();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 2) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").show();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 3) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").show();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 4) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").show();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 5) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").show();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 6) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").show();
                        $(".statistics1_table_div").hide();
                    }
                    if (obj.data.id == 7) {
                        $(".annual_table_div").hide();
                        $(".confirm_table_div").hide();
                        $(".revenue_table_div").hide();
                        $(".matching_table_div").hide();
                        $(".qingdiao_table_div").hide();
                        $(".statistics_table_div").hide();
                        $(".statistics1_table_div").show();
                    }
                }
            });
        }

        /**
         * 切换按钮时修改当前的value值
         */
        form.on('switch(jobSwitch)', function () {
            $(".operation_dept input[name=enterprise_status]").attr('type', 'hidden').val(this.checked ? 1 : 2);
        });

    });

    /**
     * 设置日期
     */
    //工商历史成立日期
    laydate.render({
        elem: '#a_date_of_establishment'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                establishStartTimeAnnual = value.split("~")[0];
                establishEndTimeAnnual = value.split("~")[1];
            } else {
                establishStartTimeAnnual = null;
                establishEndTimeAnnual = null;
            }

        }
    });
    //工商历史核准日期
    laydate.render({
        elem: '#a_approval_date'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                approvalStartTimeAnnual = value.split("~")[0];
                approvalEndTimeAnnual = value.split("~")[1];
            } else {
                approvalStartTimeAnnual = null;
                approvalEndTimeAnnual = null;
            }

        }
    });
    //工商历史创建日期
    laydate.render({
        elem: '#a_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeAnnual = value.split("~")[0];
                createEndTimeAnnual = value.split("~")[1];
            } else {
                createStartTimeAnnual = null;
                createEndTimeAnnual = null;
            }

        }
    });
    //核准历史创建日期
    laydate.render({
        elem: '#create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeApproval = value.split("~")[0];
                createEndTimeApproval = value.split("~")[1];
            } else {
                createStartTimeApproval = null;
                createEndTimeApproval = null;
            }

        }
    });
    //税务历史创建日期
    laydate.render({
        elem: '#r_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeTaxation = value.split("~")[0];
                createEndTimeTaxation = value.split("~")[1];
            } else {
                createStartTimeTaxation = null;
                createEndTimeTaxation = null;
            }

        }
    });
    //匹配历史成立日期
    laydate.render({
        elem: '#m_date_of_establishment'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                establishStartTimeMatching = value.split("~")[0];
                establishEndTimeMatching = value.split("~")[1];
            } else {
                establishStartTimeMatching = null;
                establishEndTimeMatching = null;
            }

        }
    });
    //匹配历史核准日期
    laydate.render({
        elem: '#m_approval_date'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                approvalStartTimeMatching = value.split("~")[0];
                approvalEndTimeMatching = value.split("~")[1];
            } else {
                approvalStartTimeMatching = null;
                approvalEndTimeMatching = null;
            }

        }
    });
    //匹配历史创建日期
    laydate.render({
        elem: '#m_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeMatching = value.split("~")[0];
                createEndTimeMatching = value.split("~")[1];
            } else {
                createStartTimeMatching = null;
                createEndTimeMatching = null;
            }

        }
    });
    //清吊历史创建日期
    laydate.render({
        elem: '#q_create_time'
        , type: 'date'
        , range: '~'
        , done: function (value, date, endDate) {
            if (value != null && value != undefined && value != "") {
                createStartTimeQingdiao = value.split("~")[0];
                createEndTimeQingdiao = value.split("~")[1];
            } else {
                createStartTimeQingdiao = null;
                createEndTimeQingdiao = null;
            }

        }
    });

    /**
     * 条件查询按钮方法
     * 工商历史
     */
    function searchA() {
        //这里以搜索为例
        tableIns1.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#a_enterprise_name").val(),
                socialCreditCode: $("#a_social_credit_code").val(),
                registrationNumber: $("#a_registration_number").val(),
                registrationAuthority: $("#a_registration_authority").val(),
                domination: $("#a_domination").val(),
                address: $("#a_address").val(),
                contactNumber: $("#a_contact_number").val(),
                establishStartTime: establishStartTimeAnnual,
                establishEndTime: establishEndTimeAnnual,
                approvalStartTime: approvalStartTimeAnnual,
                approvalEndTime: approvalEndTimeAnnual,
                enterpriseStatus: $("#a_enterprise_status").val(),
                liaisonManName: $("#a_liaison_man_name").val(),
                liaisonManPhone: $("#a_liaison_man_phone").val(),
                createStartTime: createStartTimeAnnual,
                createEndTime: createEndTimeAnnual,
                reportStatus: $("#a_report_status").val(),
                enterpriseType: $("#a_enterprise_type").val(),
                matching: $("#a_matching").val()
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    /**
     * 条件查询按钮方法
     * 核准历史
     */
    function searchC() {
        //这里以搜索为例
        tableIns2.reload({
            where: { //设定异步数据接口的额外参数，任意设
                registrationAuthority: $("#registration_authority").val(),
                domination: $("#domination").val(),
                address: $("#address").val(),
                createStartTime: createStartTimeApproval,
                createEndTime: createEndTimeApproval
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    /**
     * 条件查询按钮方法
     * 税务历史
     */
    function searchR() {
        //这里以搜索为例
        tableIns3.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#r_enterprise_name").val(),
                socialCreditCode: $("#r_social_credit_code").val(),
                legalRepresentative: $("#r_legal_representative").val(),
                businessPlace: $("#r_business_place").val(),
                businessScope: $("#r_business_scope").val(),
                contacts: $("#r_contacts").val(),
                contactInformation: $("#r_contact_information").val(),
                status: $("#r_status").val(),
                createStartTime: createStartTimeTaxation,
                createEndTime: createEndTimeTaxation
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    /**
     * 条件查询按钮方法
     * 匹配信息
     */
    function searchM() {
        //这里以搜索为例
        tableIns4.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#m_enterprise_name").val(),
                socialCreditCode: $("#m_social_credit_code").val(),
                registrationNumber: $("#m_registration_number").val(),
                registrationAuthority: $("#m_registration_authority").val(),
                domination: $("#m_domination").val(),
                address: $("#m_address").val(),
                contactNumber: $("#m_contact_number").val(),
                establishStartTime: establishStartTimeMatching,
                establishEndTime: establishEndTimeMatching,
                approvalStartTime: approvalStartTimeMatching,
                approvalEndTime: approvalEndTimeMatching,
                enterpriseStatus: $("#m_enterprise_status").val(),
                liaisonManName: $("#m_liaison_man_name").val(),
                liaisonManPhone: $("#m_liaison_man_phone").val(),
                createStartTime: createStartTimeMatching,
                createEndTime: createEndTimeMatching,
                reportStatus: $("#m_report_status").val(),
                enterpriseType: $("#m_enterprise_type").val(),
                matchingResult: $("#m_matching").val()
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }

    /**
     * 条件查询按钮方法
     * 清吊信息
     */
    function searchQ() {
        //这里以搜索为例
        tableIns5.reload({
            where: { //设定异步数据接口的额外参数，任意设
                enterpriseName: $("#q_enterprise_name").val(),
                socialCreditCode: $("#q_social_credit_code").val(),
                legalRepresentative: $("#q_legal_representative").val(),
                businessPlace: $("#q_business_place").val(),
                businessScope: $("#q_business_scope").val(),
                contacts: $("#q_contacts").val(),
                contactInformation: $("#q_contact_information").val(),
                status: $("#q_status").val(),
                reportStatus: $("#q_report_status").val(),
                createStartTime: createStartTimeQingdiao,
                createEndTime: createEndTimeQingdiao
            }
            , page: {
                curr: 1 //重新从第 1 页开始
            }
        });
    }
</script>
</body>
</html>